package com.seisys.util;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class Common {

	public static final String SESSION_USER = "USER";
	public static HttpSession getSession(HttpServletRequest request){
		return request.getSession();
	}
	
	public static void getWriter(HttpServletResponse response,String main,String msg) throws Exception{
		 response.setContentType("text/html;charset=utf-8");
         response.setCharacterEncoding("UTF-8");
		 PrintWriter fs=response.getWriter();
		 fs.write( main+ "( "+msg+")");
		 fs.flush();
		 fs.close();
	}
	
	public static void getWriter(HttpServletResponse response,String msg)throws Exception{
		response.setContentType("text/html;charset=utf-8");
        response.setCharacterEncoding("UTF-8");
		PrintWriter fs=response.getWriter();
		fs.write(msg);
		fs.flush();
		fs.close();
	}
	
}
